# coding: utf-8

import pytest
import datetime

from farmer import SQLBase, Model


@pytest.fixture
def db():
    return SQLBase('localhost', 'farmer_test', 3306, 'root', '')


@pytest.fixture
def Post(db):
    class _Post(Model):
        __table__ = 'post'
        __database__ = db

        class Fields:
            id = None
            author_id = None
            content = ''
            status = 1
            create_time = datetime.datetime.now
            update_time = datetime.datetime.now

    return _Post
